Skip to content

[#226] feat: pair-capability-assess-cost — multi-provider cost class at review#361

Merged
rucka merged 3 commits into
mainfrom
feat/226-assess-cost
Jul 20, 2026
Merged

[#226] feat: pair-capability-assess-cost — multi-provider cost class at review#361
rucka merged 3 commits into
mainfrom
feat/226-assess-cost

Conversation

@rucka

@rucka rucka commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the assess-cost capability skill: output-only cost classification (green/yellow/orange/red per quality-model §3.3) against a multi-provider cost-signal catalog. Sibling of assess-security — emits a verdict, writes nothing, blocks nothing.

Refs #226.

What Changed

  • New skill .skills/capability/assess-cost/SKILL.md (+ .claude/skills/pair-capability-assess-cost/SKILL.md mirror): rule-set cascade, args $diff/$story/$scope, HALT on missing quality model, unknown-cost-surface → orange (conservative/visible), AC4 no-cost → green, output format (1-line + <details>, D22), documents composition interface for future /review + /refine-story wiring.
  • New guideline guidelines/quality-assurance/cost-assessment.md: multi-provider cost-signal catalog (paid-SDK, API-key env vars, IaC, cron, queues, media, LLM, storage/egress, always-on), 4-level class scale, general heuristics, AWS-specific section, other-providers-via-adoption-link (R2.13), cost gotchas. Wired into quality-model §3.3/§7, QA README index, llms.txt.
  • Conformance test packages/knowledge-hub/src/conformance/assess-cost.test.ts (test-first: RED before authoring skill/guideline, GREEN after) — 27 tests.
  • Skill-count cascade bumped 38→39 (total) / 28→29 (capability) across the next catalog + KB prose (skills-guide, getting-started, way-of-working, llms.txt) and across apps/website docs (skills-catalog.mdx new row + count bumps in 8 mdx files + the docs-staleness test's hardcoded expectation).
  • Regenerated .claude/skills + root .pair/knowledge mirrors via the real content-ops transform (rewriteSkillReferences + rewriteSkillLinkPaths) so root == realTransform(dataset) (per the self-consistency invariant from PR fix: make pair update self-consistent for the dogfooded root install #346).

Why This Change

Epic #208 — completes the cost dimension of the classification matrix (parallel to the already-shipped assess-security). Realizes the forward references left by ADR-013 (quality-model cascade) for #226.

Scope / Deliberate Exclusions (per story directive)

  • Output-only, no $mode arg — unlike assess-security (which has $mode: audit), this story is assessment-at-review only. Report/monitoring mode (R6.3/R6.4) is a separate slice, out of scope here.
  • No blocking sign-off on red — the issue's addendum ("red ⇒ blocking human sign-off") is explicitly NOT implemented; this skill never blocks, matching the sibling assess-security review mode.
  • review-template.md untouched — review-side wiring (composing /assess-cost into /pair-process-review, T3) and the review-template changes belong to Extended code-review template (security + cost, reading budget) #228, not this batch. The skill documents its composition interface ready-to-wire; the conformance test deliberately does not assert review-side composition.
  • No new ADR/ADL — implements decisions already recorded (ADR-013, D14/D17/D21/D22, R2.13/R6.1/R6.2); no new architectural call was made here.

Files Changed

  • Added: .skills/capability/assess-cost/SKILL.md (dataset + .claude/skills mirror), guidelines/quality-assurance/cost-assessment.md (dataset + root mirror), packages/knowledge-hub/src/conformance/assess-cost.test.ts
  • Modified: quality-model.md (§3.3/§7 links), QA README.md (index), skills-guide.md, getting-started.md, way-of-working.md, llms.txt, .claude/skills/pair-next/SKILL.md (catalog row), plus root mirrors of the above; apps/website/content/docs/** (9 files: skill-count bumps + new catalog row) and apps/website/lib/docs-staleness-check.test.ts (hardcoded 38→39)

Testing

knowledge-hub: ts:check ✓, lint ✓, test ✓ (300 passed, incl. 27 new assess-cost conformance tests), check:links ✓ (0 patched), mdlint ✓
website: test ✓ (57 passed, incl. docs-staleness-check with updated 39-skill expectation), ct ✓ (20 passed)
skills:conformance ✓ (39 skills conformant — counts + catalog + KB prose)
self-consistency: skills-guide-mirror whole-file test ✓ (root == realTransform(dataset))
pre-commit hook: ts:check across all 10 packages ✓

Notes for Reviewer

  • The apps/website docs-staleness gate is a separate quality gate from the knowledge-hub's own conformance test — both track skill counts independently and both needed updating; this surfaced only when pushing (pre-push hook runs the full monorepo test suite).
  • No merge here — this PR stops at review-ready per process; independent review → fix loop → human-gated merge is the next stage.

rucka and others added 2 commits July 19, 2026 21:34
…at review

Output-only cost classification (green/yellow/orange/red per quality-model
§3.3), consistent with the assess-security sibling: emits the cost dimension
of the classification matrix (1-line verdict + collapsed details, D22),
writes nothing, blocks nothing.

- T1: author assess-cost SKILL.md (rule-set cascade, args $diff/$story/$scope,
  HALT on missing quality model, unknown-surface → orange, output format,
  composition interface)
- T2: cost-assessment.md guideline — multi-provider cost-signal catalog,
  general + AWS-specific heuristics, other providers via adoption links
  (R2.13), cost gotchas; wire §3.3/§7 of quality-model + QA README index
- conformance test assess-cost.test.ts (output-only, class scale, guideline,
  catalog registration); skill-count cascade 38→39 / 28→29 capability across
  next catalog + KB prose; regenerate .claude/skills + .pair mirror; llms.txt

Review-side wiring (compose into /review) and review template are #228, not
in this batch.

Tasks: T1, T2
Refs: #226
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…t catalog row)

Website docs-staleness gate (pre-push) tracks skill count independently
of the KB dataset/mirrors. Bumps 38->39 across docs prose + adds
assess-cost to skills-catalog.mdx.
@github-actions
github-actions Bot temporarily deployed to Website Preview July 19, 2026 19:39 Inactive
@rucka

rucka commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review — PR #361

Review Information

Review Summary

Overall Assessment

Key Changes Summary

Adds the assess-cost capability skill (output-only chromatic cost class green/yellow/orange/red), its KB guideline (multi-provider cost-signal catalog + general/AWS heuristics + gotchas), a 27-test structural conformance guard, and a thorough skill-count cascade (38→39 / 28→29) across KB prose, .claude/skills + root mirrors, and apps/website docs. Wired into quality-model §3.3/§7 and the QA README.

Business Value

Completes the Cost dimension of the classification matrix (Epic #208), parallel to the shipped assess-security. Realizes the forward references ADR-013/§3.3 left for #226.

Functionality Review — AC verification

AC Status Notes
AC1 — outputs green/yellow/orange/red + 1-line rationale + <details>, heuristics selected by adoption Met Skill Steps 1–5 + Output Format; provider selection from tech-stack/architecture/infrastructure.
AC2 — AWS heuristics apply; other providers via adoption links Met Guideline "AWS-specific heuristics" + "Other providers" (R2.13 adoption-extensible).
AC3 — cost section shown at review by /pair-process-review (1 line + collapsed, D22) NOT met — deferred to #228 Review-template + review-output wiring is #228's declared scope (T1/T2; #228 lists #226 as prerequisite). Disclosed in PR body. See Major finding.
AC4 — no cost surface ⇒ green "no cost surface touched" Met Skill Step 4 + Edge Cases; guideline class scale.
Edge: unknown surface ⇒ conservative/visible Met Mapped to orange (= "medium" on the 4-level chromatic scale), flagged unknown-surface.
Edge: missing quality model ⇒ HALT Met Step 0 BLOCKING prerequisite.

Detailed Review Comments

Major

Minor

  • [quality-model.md §2, line 21 (dataset + root mirror)] The Pillars table still reads `assess-cost` (cost-signal catalog, forthcoming). This PR de-staled §3.3 and §7 (removed "forthcoming"/"not yet published") but missed §2. Now that the skill and catalog ship in this PR, "forthcoming" is inaccurate. Recommendation: drop "forthcoming" on line 21 in both the dataset and root-mirror copies (e.g. `assess-cost` (cost-signal catalog)).

  • [assess-cost/SKILL.md line 105 / §3.2 grounding] The skill cites "§3.2 floor semantics applied to the cost class" (review may only confirm-or-raise, never lower). But §3.2's floor/never-lower rule is phrased about the risk tier (max), and §3.2 explicitly states cost is not part of that max ("it is its own class, computed independently"). §3.3 does not itself state a floor rule for the cost class. The extension from the D17 "built twice" principle is reasonable, but the citation is a mild extrapolation. Recommendation (low priority): either add an explicit floor sentence to §3.3 for the cost class, or soften the skill's "§3.2 ... applied to the cost class" wording to reference D17 "built twice" instead.

  • [packages/knowledge-hub/src/conformance/assess-cost.test.ts] The conformance test is structural-only (string-contains over the markdown) — consistent with the sibling assess-security.test.ts convention for prompt-artifact skills, so acceptable. But the story's testing strategy called for behavioral calibration ("4 sample changes, one per class, + one unknown-surface change") and the DoD lists "standalone invocation verified" — manual-QA activities whose completion is not evidenced in the PR. Recommendation: confirm the sample-diff calibration was performed (the story's own risk note — "heuristics too generic → everything medium/orange" — depends on it), or track it as follow-up QA.

Questions

  • [guideline / story edge-case wording] The story's Edge Cases say unknown surface ⇒ "medium"; the implementation uses orange. This reads as consistent with the 4-level chromatic scale (green<yellow<orange<red, medium↔orange, the more-conservative of the two middle classes) and the "conservative, visible, never silently green" intent — please confirm orange (not yellow) is the intended mapping.

Technical Standards / Code Quality

  • Skill structure mirrors assess-security faithfully (frontmatter, Arguments, Rule Set cascade, Algorithm steps, Output Format, Composition Interface, Edge Cases, Graceful Degradation, Notes). D17/D21 layering respected — no heuristics or provider names live in the skill; the catalog + heuristics live in the guideline; R2.13 provider-agnostic core is real.
  • Mirror self-consistency (PR fix: make pair update self-consistent for the dogfooded root install #346 invariant) holds: /assess-cost slash-refs correctly rewritten to /pair-capability-assess-cost in the .claude/skills mirror; KB doc links resolve identically (dataset-skill and mirror-skill are both 3 levels above their respective .pair/knowledge); check:links = 0 patched.
  • Section references (§2, §3.2, §3.3, §5, §7) all verified accurate against quality-model.md; guideline internal links (cost-optimization / aws-deployment / provider-evaluation / multi-cloud) all resolve.
  • Skill-count cascade is complete and internally consistent: no stale 38/28 capability remains anywhere in KB, mirrors, or website; catalog-derivation math (9 process + 29 capability + /next = 39) updated in next/SKILL.md; assess-output-only.test.ts correctly leaves assess-cost out of its "8 decision assess-*" list (assess-cost is a review-classifier with its own dedicated test, like assess-security).
  • All 27 conformance assertions verified by inspection against the actual files — they resolve.

Testing Review

  • 27 new structural conformance tests (dataset + mirror parity for skill, guideline, catalog, counts). Test-first (RED→GREEN) claimed. Coverage is structural, not behavioral — acceptable by the established markdown-skill convention (see Minor above re: manual calibration).

Security Review

  • green — no findings. Documentation/KB-only change (markdown skill + guideline + test + doc counts). No executable product surface, no inputs, no secrets, no dependencies introduced. assess-cost is output-only and writes nothing.

Adoption Compliance

  • No new technical decision introduced — implements decisions already recorded (ADR-013, D14/D17/D21/D22, R2.13/R6.1/R6.2). No new ADR/ADL required (correctly none added). Conforms to the assess-* family conventions and the quality-model three-layer principle.

Tech Debt

  • None introduced. The two doc-precision Minors (§2 "forthcoming"; §3.3 cost-floor grounding) are trivial in-scope cleanups, not debt.

Decision

Approved with Comments. The code that is present is correct, complete for its stated scope (AC1/AC2/AC4), consistent across every mirror/count/doc surface, and cleanly follows the sibling convention. The one Major item (AC3 + red-sign-off deferred to #228) is disclosed and tracked; the only blocking-adjacent question is process, not code: the human merge gate should resolve the "Closes #226"-with-AC3-unmet tension (keep #226 open until #228, or move AC3 to #228). Recommended in-PR fix before merge: the §2 "forthcoming" stale line (Minor).

…wice not §3.2 floor

- quality-model.md (dataset+root): assess-cost catalog no longer 'forthcoming' (ships in this PR)
- assess-cost SKILL.md (dataset+mirror): cost class refinement→review floor cited via D17 'built twice' (estimated vs actual, more conservative wins) instead of §3.2 risk-tier floor semantics
@github-actions
github-actions Bot temporarily deployed to Website Preview July 19, 2026 20:27 Inactive
@rucka

rucka commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator Author

Remediation — round 1 (commit d9627e7)

Per finding:

  • [Minor] quality-model.md:21 cites assess-cost as "(cost-signal catalog, forthcoming)" (§2 Pillars table) → dropped "forthcoming" (the skill + catalog ship in this PR); applied in BOTH copies — .pair/knowledge/guidelines/quality-assurance/quality-model.md, packages/knowledge-hub/dataset/.pair/knowledge/guidelines/quality-assurance/quality-model.md
  • [Minor] SKILL.md:105 cites «§3.2 floor semantics applied to the cost class» (§3.2 is the risk-tier max, computes cost independently) → softened to cite D17 "built twice": the class is estimated from story context at refinement and re-derived from the diff at review, the more conservative of the two wins; applied in BOTH copies — packages/knowledge-hub/dataset/.skills/capability/assess-cost/SKILL.md, .claude/skills/pair-capability-assess-cost/SKILL.md
  • [Questions/vocab] scale vocabulary green/low/medium/red vs green/yellow/orange/red → the files I own already use the 4-level chromatic scale cost:green|yellow|orange|red consistently (guideline cost-assessment.md §3.3 + assess-cost SKILL), and unknown-surface → orange is already the documented conservative default. The low/medium variant appears only in the issue body, which was intentionally not touched. No change needed in guideline/skill.
  • [Minor · QA] calibration (4 sample-diff + unknown-surface) and "standalone invocation verified" → not automated (would be fictitious tests). Tracked as a manual-QA follow-up (see below).

Not changed (escalated): none.

Follow-up QA (manual, tracked): calibrate assess-cost against 4 representative sample diffs + an unknown-surface case, and verify standalone /assess-cost invocation end-to-end. To be run at #228 (review-side wiring) alongside AC3/rendering.

Note: PR body updated Closes #226Refs #226#226 stays open until #228 delivers AC3/rendering.

Quality gates: PASS — assess-cost conformance (27) + transfer-dataset root-equality (29) + skills-guide-mirror (15) tests green; check:links clean (dataset + root); mdlint clean; ts:check green (pre-commit).
→ Re-review requested.

@rucka
rucka merged commit 4a43824 into main Jul 20, 2026
3 checks passed
@rucka
rucka deleted the feat/226-assess-cost branch July 20, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant